# 最小编译方式，通过alpine基础镜像进行编译docker 服务镜像。
# docker build -t trevet/library-cache-server:0.0.4 .
FROM alpine:3.20
#RUN echo https://mirrors.aliyun.com/alpine/v3.20/main/ > /etc/apk/repositories && \
#        echo https://mirrors.aliyun.com/alpine/v3.20/community/ >> /etc/apk/repositories && \
#    apk update && apk upgrade && apk add openjdk8
RUN echo http://res.trevet.cn/alpine/agent/cache/v`cat /etc/alpine-release`/main/ > /etc/apk/repositories && \
            echo http://res.trevet.cn/alpine/agent/cache/v`cat /etc/alpine-release`/community/ >> /etc/apk/repositories && \
        apk update && apk upgrade && apk add openjdk8
ADD target/library-cache-server-*.jar /home/app.jar
WORKDIR /home
EXPOSE 81
CMD ["java","-jar","app.jar"]